VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form frmSAPI 
   BorderStyle     =   1  'Fixed Single
   ClientHeight    =   2190
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   3855
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2190
   ScaleWidth      =   3855
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdTest 
      Default         =   -1  'True
      Height          =   375
      Left            =   1200
      TabIndex        =   2
      Top             =   1680
      Width           =   1215
   End
   Begin VB.CommandButton cndOK 
      Height          =   375
      Left            =   2520
      TabIndex        =   3
      Top             =   1680
      Width           =   1215
   End
   Begin MSComctlLib.Slider Slider1 
      Height          =   495
      Left            =   120
      TabIndex        =   1
      Top             =   1080
      Width           =   3615
      _ExtentX        =   6376
      _ExtentY        =   873
      _Version        =   393216
      Max             =   20
      SelStart        =   10
      Value           =   10
   End
   Begin VB.ComboBox VoiceCB 
      Height          =   315
      Left            =   120
      Style           =   2  'Dropdown List
      TabIndex        =   0
      Top             =   360
      Width           =   3615
   End
   Begin VB.Label Label2 
      Height          =   255
      Left            =   120
      TabIndex        =   5
      Top             =   840
      Width           =   1335
   End
   Begin VB.Label Label1 
      Height          =   255
      Left            =   120
      TabIndex        =   4
      Top             =   120
      Width           =   2415
   End
End
Attribute VB_Name = "frmSAPI"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Sub PopulateVoicesBox()
    
    Dim Token As ISpeechObjectToken

    For Each Token In frmMain.SpeechInterface.m_voice.GetVoices
        VoiceCB.AddItem (Token.GetDescription())
    Next

End Sub

Private Sub cmdTest_Click()
frmMain.SpeechInterface.Say lang.SpeechMsg(0), True
End Sub

Private Sub cndOK_Click()
Unload Me
End Sub

Private Sub Form_Load()
Dim c As Byte

Label1.Caption = lang.Messages(41)
Label2.Caption = lang.Messages(42)
cmdTest.Caption = lang.Buttons(10)
cndOK.Caption = lang.Buttons(2)
Me.Caption = lang.Messages(43)

PopulateVoicesBox
Slider1.Value = frmMain.SpeechInterface.m_voice.Rate + 10
  For c = 0 To frmMain.SpeechInterface.m_voice.GetVoices().Count - 1
    If LCase(frmMain.SpeechInterface.m_voice.GetVoices().Item(c).GetDescription) = LCase(frmMain.SpeechInterface.m_voice.Voice.GetDescription) Then frmMain.whichvoice = c
  Next
  If frmMain.whichvoice > -1 Then _
  VoiceCB.ListIndex = frmMain.whichvoice
End Sub





Private Sub Slider1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyHome Then
frmMain.SpeechInterface.m_voice.Rate = -10
ElseIf KeyCode = vbKeyEnd Then
frmMain.SpeechInterface.m_voice.Rate = 10
End If
End Sub

Private Sub Slider1_Scroll()
    frmMain.SpeechInterface.m_voice.Rate = Slider1.Value - 10
End Sub


Private Sub VoiceCB_Click()
    ' change the voice to the selected one
    Set frmMain.SpeechInterface.m_voice.Voice = frmMain.SpeechInterface.m_voice.GetVoices().Item(VoiceCB.ListIndex)
End Sub

